home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
170_01
/
zapload.doc
< prev
next >
Wrap
Text File
|
1980-01-01
|
9KB
|
260 lines
.he ZAPLOAD- Binary to Intel Hex (c) T. Jennings 1980, 1981, 1982 Page #
ZAPLOAD- MSDOS version
ZAPLOAD can be used to convert any file (binary is
assumed) to INTEL hex format, and send to one or more
destinations: a disk file, the punch device, or the printer.
There are many options to select various things; ones or twos
complement checksums, where to send the hex, specifying the load
and start addresses, etc. All of the available options are listed
below, followed by a more detailed description of each.
The very last section deals with connecting a Sunrise
Electronics ZAP-80 EPROM burner to a computer via ZAPLOAD, since
that was it's original intent.
ZAPLOAD gives a quick list and description of it's
commands when operated improperly. To get this list, type ZAPLOAD
without any command line options. You will also get the list
whenever you make any command errors.
.pa
Zapload is executed from an MSDOS system, and converts
MSDOS files from the disk, to INTEL hex format. All options are
specified on the command line when ZAPLOAD is run. ZAPLOAD has
the following syntax:
ZAPLOAD <file to convert> <any legal options ...>
After ZAPLOAD has sent the entire file, it will display
on the console a 16 bit two's complement checksum of every data
byte sent. This checksum is of the data bytes only. This can be
used in conjunction with the destination device to provide
another check of data integrity.
An INTEL hex file consists of one or more data records,
followed by an end of file record. These records have the
following format:
DATA RECORDS: : bb llll tt dd dd dd .... cc
: says this is the start of a record,
bb is the number of data bytes to follow,
llll is the address to load the data byte at,
tt is the record type, 00 for data,
dd dd ... are the data bytes,
cc is the checksum of bb llll tt and all dd data
bytes.
END OF FILE RECORDS: : bb ssss tt cc
: is the same as a data record,
bb is zero, (no data),
ssss is the program start address,
tt is 01 to indicate end of file,
cc is the checksum of bb ssss and tt.
There are no data bytes.
After the cc bytes have been sent, a CR LF sequence is
sent for readability. Programs that read INTEL hex ignore any
characters before the :, and after the cc checksum. Or at least
are supposed to.
If you specify no options at all, ZAPLOAD processes the
file but does not send the output anywhere. The following are the
defaults for Intel Hex generation:
- 32 byte data records (20 hex),
- 2's complement checksums,
- Initial load address of 0,
- Start address of 0.
.pa
ZAPLOAD OPTIONS
There are many options; these fall roughly into two
categories; those that control the record format, for non-
standard devices (damn them) and those that control where to send
it as it is generated.
Options are specified on the command line, following the
filename. Each option is a single letter, and may appear in any
order. Some options take an additional argument; like setting the
load address. In these cases the argument follows the option
letter, seperated by one or more spaces, like so:
ZAPLOAD file l 8000
Option letters may be optionally preceded by a -, for
UNIX freaks, like so:
ZAPLOAD file -l 8000
RECORD FORMAT OPTIONS
b <hex number>
Set the number of bytes sent per record from the default
20 hex to <hex number>. <hex number> must be less than 1024.
Please do not use 0. (BUG: ZAPLOAD will not catch a byte count of
zero. It might try to produce 65535 byte records, and bomb
everything.)
z
Generate ones complement checksums instead of two's.
Obscure option for use with non-standard devices.
l <hex number>
Set the load address to <hex number>. The default is 0
hex if this option is not used. The load address for each record
sent will increment by the byte count.
r <hex number>
Change the default run address of 0 to <hex number>. This
is used only in the end of file record, to indicate the starting
address of the file just sent. Things like EPROM burners do not
use this; some computers with download facilities might.
.pa
FILE DESTINATION CONTROLS
The following options control where the file is sent, and
how it is sent. If none of these are specified, it is merely sent
to the console. Each record is always typed on the console,
character by character, as it is sent, unless the 'X' option is
given. Running ZAPLOAD with only the 'X' option would cause the
file to be sent nowhere at all. (Why?) A control-Z terminating
character is sent to the destination device after the file is
transferred.
a
Send to the aux device. This could also be done via the
'f' option: f AUX. See below.
f <file name>
Create a file <file name>, and send each byte there. This
can be used to generate INTEL hex disk to disk, without using any
external devices.
w <decimal number>
Software delay by <decimal number> after each character
is sent. This can be used for those poorly designed devices that
require but do not use character by character handshake. The
default here is 0, obviously, and 10 is about 50 milliseconds for
a 4MHz Z80. This was necessary for the ZAP-80, as is has a
software UART, and takes too long to process a byte to keep up.
Pretty useless with disk files.
e <decimal number>
Software delay after the CR LF sequence at the end of a
record. Some loaders require more time at the end of the record,
in order to generate and check the checksum. The delay w <decimal
number> is still done after sending the last cc byte, but not on
the CR LF sequence.
.pa
General Controls
s <dddd>
Skip <dddd> decimal bytes at the beginning of the file
before processing. This is useful when generating HEX files from
CP/M .CMD files or the like that have a header at the beginning.
o
e
Process only even or odd numbered bytes. This is very
useful when generating EPROM code for 16 bit processors like the
8086, that have even bytes in one PROM, and the odd ones in
another. By using the form:
zapload file.cmd s 128 e f low.hex
and
zapload file.cmd s 128 o f hi.hex
You can make the two EPROM files necessary for an 8086
bootstrap ROM, or whatever.
x
List output on the console. All hex records generated are
typed.
.pa
TYPICAL USAGE
Here are some examples for loading INTEL hex to some
common devices:
zapload test.com x
This loads test.com to the console, and sends 32 byte
records, load address of 0, start address of zero.
zapload test.com e 10 w 10
This loads a ZAP80 tied to the punch port, with the
necessary software delays to accomodate the ZAP80.
zapload test.com f test.hex
Convert file test.com to hex, and make a hex file
test.hex. This "undoes" Digital Research's LOAD utility.
zapload test.com l 100 r 100 p f test.hex x
Convert test.com to Intel hex, send it to the CP/M PUN:
device, to the disk file TEST.HEX, and listing it on
the console. The load address starts at 100h, and the run address
is 100h.
.pa
Connecting the ZAP-80 to FIDO or any other computer
You will not find this data in any Sunrise Electronics
documentation. The ZAP80 is filled with bugs, and the manual is
terrible.
- The ZAP80 requires 300 baud, 1 1/2 stop bits. Idiots.
Use two stop bits.
- The ZAP 80 cannot be run faster than 300 baud, and can
not handle even this without software delays.
- Though they claim that it uses the RTS line or
whatever, it really does not.
- Even though each record may be loading properly, the
display will always say there is a load error after the first
record. Ignore it, and once the entire file is sent, do the
following:
Reset the ZAP80, and checksum the entire data ares